home *** CD-ROM | disk | FTP | other *** search
-
- function units_dinorobot_setup()
- units_setup(11,true,ENET_EFFECT_PS_SETUPSMOKE_LARGE,ENET_EFFECT_GEOMETRY_DINOROBOTSHADOW)
- end
-
- function units_dinorobot_resetup()
- units_setup(11,true,nil,ENET_EFFECT_GEOMETRY_DINOROBOTSHADOW)
- end
-
- function units_dinorobot_select()
- units_select(25,2)
- end
-
- function units_dinorobot_unselect()
- units_unselect()
- end
-
- function units_dinorobot_selectenemy()
- uniGetExecutor():addSimpleEffect(ENET_EFFECT_SELECTEDGEOMETRY_ENEMY)
- end
-
- function units_dinorobot_damaged()
- uniGetExecutor():applyDamage(uniGetLife())
- end
-
- function units_dinorobot_highlight()
- uniGetExecutor():addEffectWithRadius(ENET_EFFECT_GEOMETRY_HIGHLIGHT,15)
- end
-
- function units_dinorobot_explode()
- units_explode_xxl2()
- end
-
- function units_dinorobot_fire1()
- uniSetLife(uniGetLife() / 5.0)
- local unit = uniGetExecutor()
- if(unit:getObjectPositionInLocalSpace(uniGetTarget()).z > 0) then
- unit:play3DSound("bull gun rotate.wav",0)
- waitDeath(unit:getBone(ENBT_GUNTOWER):addRotationEffect(ENET_EFFECT_ROTATE_GUNTOWERTOTARGET,MATH_PI,uniGetTarget()))
- else
- waitDeath(unit:getBone(ENBT_GUNTOWER):addRotationEffect(ENET_EFFECT_ROTATE_GUNTOWERDEFAULT,MATH_PI))
- unit:play3DSound("bullfrog turn3.wav",0)
- unit:addAnimationToQueue(ENAT_TURNING,MATH_INFINITY)
- waitDeath(unit:addRotationEffect(ENET_EFFECT_ROTATE_UNITTOTARGET,MATH_PI * 0.35,uniGetTarget()))
- unit:setCurrentAnimationRepeatCount(1)
- while(unit:getCurrentAnimation() == ENAT_TURNING) do pause() end
- end
- local gun_rotation = unit:getBone(ENBT_RECOIL,0):addRotationEffect(ENET_EFFECT_ROTATE_SPIRAL,MATH_PI * 6.0)
- waitDeath(unit:getBone(ENBT_GUN):addRotationEffect(ENET_EFFECT_ROTATE_GUNTOTARGET,MATH_PI / 3.0,uniGetTarget()))
- local firespot = unit:getBone(ENBT_FIRE1,0)
- local i = 0
- for i = 0,4 do
- unit:play3DSound("bull fire1.wav",0)
- firespot:addSimpleEffect(ENET_EFFECT_DINOROBOTSHOT_FLY):executeCommand(ENC_FIRE1)
- firespot:addBulletEffect(ENET_EFFECT_PS_DOTALIENSHOT):suspendedDestroy(0.5)
- pause(0.2)
- end
- pause(0.5)
- gun_rotation:destroy()
- unit:getBone(ENBT_RECOIL,0):addRotationEffect(ENET_EFFECT_ROTATE_SPIRAL,MATH_PI * 3.0):delayedDestroy(1.0)
- unit:addFireArrow()
- end
-
- function units_dinorobot_fire2()
- uniSetLife(uniGetLife() / 2.0)
- local unit = uniGetExecutor()
- local firespots = {}
- firespots[0] = unit:getBone(ENBT_FIRE2,0)
- firespots[1] = unit:getBone(ENBT_FIRE2,1)
- local recoils = {}
- recoils[0] = unit:getBone(ENBT_RECOIL,2)
- recoils[1] = unit:getBone(ENBT_RECOIL,1)
- unit:play3DSound("bullfrog turn3.wav",0)
- unit:addAnimationToQueue(ENAT_TURNING,MATH_INFINITY)
- waitDeath(unit:parabolicTargetting(uniGetTarget(),unit:getBone(ENBT_FIRE2,0),MATH_PI * 0.35))
- unit:setCurrentAnimationRepeatCount(1)
- while(unit:getCurrentAnimation() == ENAT_TURNING) do pause() end
- unit:play3DSound("bull fire2.wav",0)
- firespots[0]:addSimpleEffect(ENET_EFFECT_DINOROBOTSHOT_FLY2):executeCommand(ENC_FIRE2)
- firespots[0]:addSimpleEffect(ENET_EFFECT_PS_DINOROBOTSHOT):suspendedDestroy(1.5)
- recoils[0]:gunRecoil(0,0.2,10)
- pause(1.0)
- unit:addAnimationToQueue(ENAT_TURNING,MATH_INFINITY)
- unit:play3DSound("bullfrog turn3.wav",0)
- waitDeath(unit:parabolicTargetting(uniGetTarget(),unit:getBone(ENBT_FIRE2,1),MATH_PI * 0.35))
- unit:play3DSound("explosion.wav",0)
- unit:setCurrentAnimationRepeatCount(1)
- while(unit:getCurrentAnimation() == ENAT_TURNING) do pause() end
- unit:play3DSound("bull fire2.wav",0)
- firespots[1]:addSimpleEffect(ENET_EFFECT_DINOROBOTSHOT_FLY2):executeCommand(ENC_FIRE2)
- firespots[1]:addSimpleEffect(ENET_EFFECT_PS_DINOROBOTSHOT):suspendedDestroy(1.5)
- recoils[1]:gunRecoil(0,0.2,10)
- pause(1.0)
- unit:play3DSound("explosion.wav",0)
- unit:addFireArrow()
- end
-
- function units_dinorobot_move()
- local unit = uniGetExecutor()
- local sound = unit:play3DSound("bullfrog turn3.wav",1)
- unit:addAnimationToQueue(ENAT_TURNING,MATH_INFINITY)
- unit:addAnimationToQueue(ENAT_IDLETIMEOUT1,1)
- unit:addAnimationToQueue(ENAT_IDLETIMEOUT2,1)
- unit:addAnimationToQueue(ENAT_GO,MATH_INFINITY)
- local steps = {}
- steps[0] = unit:getBone(ENBT_STEPEMITTER,0):addSimpleEffect(ENET_EFFECT_DYNAMICGEOMETRY_BULLFROGSTEPSEMITTER_LEFT)
- steps[1] = unit:getBone(ENBT_STEPEMITTER,1):addSimpleEffect(ENET_EFFECT_DYNAMICGEOMETRY_BULLFROGSTEPSEMITTER_RIGHT)
- for i = 0,1 do
- steps[i+2] = unit:getBone(ENBT_STEPEMITTER,i):addSimpleEffect(ENET_EFFECT_PS_TRACKSMOKE)
- end
- steps[4] = unit:getBone(ENBT_STEPEMITTER,2):addSimpleEffect(ENET_EFFECT_DYNAMICGEOMETRY_BULLFROGSTEPSEMITTERSMALL_LEFT)
- steps[5] = unit:getBone(ENBT_STEPEMITTER,3):addSimpleEffect(ENET_EFFECT_DYNAMICGEOMETRY_BULLFROGSTEPSEMITTERSMALL_RIGHT)
- waitDeath(unit:addRotationEffect(ENET_EFFECT_ROTATE_UNIT,MATH_PI * 0.35))
- unit:setCurrentAnimationRepeatCount(1)
- while unit:getCurrentAnimation() ~= ENAT_IDLETIMEOUT2 do
- pause()
- end;
- sound:destroy()
- sound = unit:play3DSound("bullfrog moves.wav",1)
- waitDeath(unit:addMoveEffect(ENET_EFFECT_MOVE_LINEAR,64))
- unit:resetAnimations()
- sound:destroy()
- unit:addAnimationToQueue(ENAT_SELECTED,1)
- while(unit:getCurrentAnimation() == ENAT_SELECTED) do pause() end
- for i = 0,1 do
- if(unit:getScale() < 1.0) then
- steps[i]:destroy()
- else
- steps[i]:setTransformOwner()
- steps[i]:suspendedDestroy(70)
- end
- steps[i+2]:suspendedDestroy(1.0)
- end
- for i = 4,5 do
- if(unit:getScale() < 1.0) then
- steps[i]:destroy()
- else
- steps[i]:setTransformOwner()
- steps[i]:suspendedDestroy(70)
- end
- end
- end
-
- registerCommand(ENSCRIPTSET_DINOROBOT,ENC_MOVE,"units_dinorobot_move")
- registerCommand(ENSCRIPTSET_DINOROBOT,ENC_FIRE1,"units_dinorobot_fire1")
- registerCommand(ENSCRIPTSET_DINOROBOT,ENC_FIRE2,"units_dinorobot_fire2")
- registerCommand(ENSCRIPTSET_DINOROBOT,ENC_SELECT,"units_dinorobot_select")
- registerCommand(ENSCRIPTSET_DINOROBOT,ENC_SELECTENEMY,"units_dinorobot_selectenemy")
- registerCommand(ENSCRIPTSET_DINOROBOT,ENC_UNSELECT,"units_dinorobot_unselect")
- registerCommand(ENSCRIPTSET_DINOROBOT,ENC_SETUP,"units_dinorobot_setup")
- registerCommand(ENSCRIPTSET_DINOROBOT,ENC_RESETUP,"units_dinorobot_resetup")
- registerCommand(ENSCRIPTSET_DINOROBOT,ENC_DAMAGED,"units_dinorobot_damaged")
- registerCommand(ENSCRIPTSET_DINOROBOT,ENC_EXPLODE,"units_dinorobot_explode")
- registerCommand(ENSCRIPTSET_DINOROBOT,ENC_HIGHLIGHT,"units_dinorobot_highlight")
- registerCommand(ENSCRIPTSET_DINOROBOT,ENC_INSIDE,"units_inside")
-
- -- make description of unit
- desc = getEffectDescriptionP(ENET_UNIT_DINOROBOT)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "dinorobot.rmd"
- desc.ScriptSet = ENSCRIPTSET_DINOROBOT
- desc.MoveType = ENMOVE_GROUND
- desc.RenderType = ENRENDERTYPE_GEOMETRY
- desc.Material = ENMAT_RIGIDSKINNEDMESH
- desc.MaterialColors = units_materialcolors_human
-
- -- shadow
- desc = getEffectDescriptionP(ENET_EFFECT_GEOMETRY_DINOROBOTSHADOW)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "dinorobot_shadow.rmd"
- desc.RenderType = ENRENDERTYPE_SHADOW
- desc.Material = ENMAT_SHADOW
- desc.MaterialColors = units_materialcolors_shadow
-
- -- register new unit to logic
- unitDesc = logic_getUnitDescP(34)
- unitDesc.group = 0
- unitDesc.order = 5
- unitDesc.unit_res_id = ENET_UNIT_DINOROBOT
- unitDesc.unit_icon_id = "Bullfrog_a_small_normal.dds"
- unitDesc.active_id = "Bullfrog_a_small_active.dds"
- unitDesc.pressed_id = "Bullfrog_a_small_pressed.dds"
- unitDesc.small_icon_id = "Bullfrog_l_stats.dds"
- unitDesc.big_icon_id = "Bullfrog_a_big_normal.dds"
- unitDesc.HP = 11
- unitDesc.MP = 20
- unitDesc.WR = 2
- unitDesc.min_WR = 0
- unitDesc.WD = 2
- unitDesc.WR2 = 2
- unitDesc.min_WR2 = 0
- unitDesc.WD2 = 3
- unitDesc.ability = 1
- unitDesc.transport = 0
- unitDesc.value = 6
- unitDesc.race = 1
- unitDesc.fire_pause = 0.6
- unitDesc.move_pause = 0.5
- unitDesc.unit_info_scale = 0.07
- unitDesc.scn_name = "SUPEROSTRICH"
-